﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Windows.Media.Imaging;
using Mogubang_Sl.Core;

namespace Mogubang_Sl.Views
{
    public partial class AddToolItem : UserControl
    {
        public AddToolItem()
        {
            InitializeComponent();
            this.StoryboardShowHide.Completed += StoryboardShowHide_Completed;
        }

        void StoryboardShowHide_Completed(object sender, EventArgs e)
        {
            this.image.Opacity = 0;
        }

        internal void SetToWood()
        {
            this.image.Source = new BitmapImage(new Uri("/Images/tool_Wood.png", UriKind.RelativeOrAbsolute));
        }

        internal void Show()
        {
            SoundManager.PlayEffect(SoundManager.addTool);
            this.StoryboardShowHide.Begin();
        }

        internal void SetToBomb()
        {
            this.image.Source = new BitmapImage(new Uri("/Images/tool_Bomb.png", UriKind.RelativeOrAbsolute));
        }
    }
}
